package com.copa.ums.common.util;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;

import java.io.IOException;

/**
 * @author copa
 * @createDate 2022-09-26 09:19
 * @function 爬虫工具
 */
public class JsoupUtils {

    public static Document getBody(String url) throws IOException {
        Document document = Jsoup.connect(url)
                .userAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36")
                .get();
        return document;
    }
}
